/*
ID: guoxu1
PROG: friday
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
using namespace std;

#define cin fin
#define cout fout

const int day_in_month[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

int main()
{
	ifstream fin( "friday.in" );
	ofstream fout( "friday.out" );
	int N = 0;
	cin >> N;

	int weekday[7] = {0};
	int begin = 0;
	for( int i = 0; i < N; i++ )
	{
		int year = 1900 + i;
		bool leap = ( year % 4 == 0 && year % 100 != 0 ) || ( year % 400 == 0 );
		int days = begin;
		for( int j = 0; j < 12; j++ )
		{
			weekday[ (days + 13) % 7 ]++;
			days += day_in_month[j];
			if( leap && j == 1 ) days++;
		}
		begin = days % 7;
	}
	cout << weekday[6];
	for( int i = 0; i < 6; i++ )
	{
		cout << " " << weekday[i];
	}
	cout << endl;

	return 0;
}
